#!/bin/bash
name=$1
score=$2
if [ -z "$name" ] || [ -z "$score" ]; then
    echo "错误：请传入2个参数，格式为./test10_3.sh 姓名 成绩"
    exit 1  
fi
if ! [[ $score =~ ^[0-9]+$ ]]; then
    echo "错误：成绩必须是整数"
    exit 1
fi
if [ $score -lt 0 ] || [ $score -gt 100 ]; then
    echo "错误：成绩必须在0-100之间"
    exit 1
fi
if [ $score -ge 90 ] && [ $score -le 100 ]; then
    comment="优秀"
elif [ $score -ge 80 ] && [ $score -le 89 ]; then
    comment="良好"
elif [ $score -ge 60 ] && [ $score -le 79 ]; then
    comment="及格"
else  
    comment="不及格"
fi
echo "综合评语：$comment"
